<script setup>
import { onBeforeMount, reactive } from 'vue';
import Probe from './Probe.vue';
const props = defineProps({
    container: {
        type: Object
    },
    containerIndex: {
        type: Number,
    },
    containerType: {
        type: String
    }
    
})
onBeforeMount(()=>{
    // 检查是否有startupProbe这个字段
    // if (!props.container.hasOwnProperty('startupProbe')){
    //     props.container['startupProbe'] = {}
    // }
})
// 更改检查方式的回调函数
// const probeChangedRollback = (probeType) => {
//     props.container[probeType] = 
// }
</script>

<template>
    <!-- startup -->
    <Probe :container-type="props.containerType" :container-index="props.containerIndex" :probe="props.container.startupProbe" probe-type="startupProbe" @probe-changed-rollback="(value)=> {props.container.startupProbe=value}"></Probe>
    <Probe :container-type="props.containerType" :container-index="props.containerIndex" style="margin-top: 10px;" :probe="props.container.livenessProbe" probe-type="livenessProbe" title="存活探针(LivenessProbe)"  @probe-changed-rollback="(value)=> {props.container.livenessProbe=value}"></Probe>
    <Probe :container-type="props.containerType" :container-index="props.containerIndex" style="margin-top: 10px;" :probe="props.container.readinessProbe" probe-type="readinessProbe" title="就绪探针(ReadinessProbe)"  @probe-changed-rollback="(value)=> {props.container.readinessProbe=value}"></Probe>
</template>

<style scoped>

</style>
